    function Vue(parameters) {
        let vue = {};
        vue.routes = parameters.routes || [];
        vue.init = function() {
            document.querySelectorAll(".viewbox-menu-item").forEach((item, index) => {
                item.addEventListener("click", function(e) {
                    if (this.getAttribute("id") == 'menu6') {
                        if (window.location.href.indexOf('ics') > -1) {
                            window.open('http://www.njdtwise.com/FirePM/html/index/index.html')
                        } else if (window.location.href.indexOf('dev') > -1) {
                            window.open('http://dev.njdtwise.com/FirePM/html/index/index.html')
                        } else {
                            window.open('../../../FirePM/html/index/index.html')
                        }

                    } else {
                        $('.details-box').hide();
                        let event = e || window.event;
                        event.preventDefault();
                        if (window.location.hash.indexOf(this.getAttribute("href")) > -1) {
                            $('.site-top-item').removeClass("selected");
                            $('.street-count').removeClass("selected");
                            vue.routerChange();
                        }
                        window.location.hash = this.getAttribute("href");
                    }

                }, false);
            });

            window.addEventListener("hashchange", () => {
                vue.routerChange();
            });

            vue.routerChange();
        };
        vue.routerChange = () => {
            let nowHash = window.location.hash;
            let index = vue.routes.findIndex((item, index) => {
                return nowHash == ('#' + item.path);
            });
            if (index >= 0) {
                /* document.querySelector("#router-view").innerHTML = vue.routes[index].component;
                 */

                new vue.routes[index].function;
                let menuArr = $(".viewbox-menu-item");
                $.each(menuArr, function(index, el) {
                    $(el).find('img').attr("src", "../static/img/home/" + el.id + ".png");
                });

                $(".viewbox-menu-item").removeClass("selected");
                $('#' + vue.routes[index].id).addClass("selected");
                $(".viewbox-menu-item.selected").find('img').attr("src", "../static/img/home/" + vue.routes[index].id + "_sel.png");


            } else {
                let defaultIndex = vue.routes.findIndex((item, index) => {
                    return item.path == '*';
                });
                if (defaultIndex >= 0) {
                    window.location.hash = vue.routes[defaultIndex].redirect;
                }
            }
        };

        vue.init();
    }

    new Vue({
        routes: [{
            path: '/home',
            id: 'menu1',
            function: function() {
                $('.viewbox-left-index.viewbox-left-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-index.viewbox-right-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-mid-index.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                overviewIndex(1);
                fireApplyByThirtyDays();
                electricitySafetyView();
                fireEyesCurrentStatus(1);
                showSiteDetail();
            }
        }, {
            path: '/record',
            id: 'menu2',
            function: function() {
                $('.left-site-record.viewbox-left-site-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.mid-site-record.viewbox-mid-site-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.left-site-record-top.viewbox-right-record-box').removeClass("hidden-view").siblings().addClass("hidden-view");

                $('.viewbox-left-site.viewbox-left-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-site.viewbox-right-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-mid-site.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");


                fireRecordByThirtyDays()
                loadFireRecordTable(1)
                searchType = 1;
                $('.mid-site-record-tool input').val("")
            }

        }, {
            path: '/inspection',
            id: 'menu3',
            function: function() {
                $('.left-site-inspection.viewbox-left-site-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.mid-site-record.viewbox-mid-site-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.left-site-inspection-top.viewbox-right-record-box').removeClass("hidden-view").siblings().addClass("hidden-view");


                $('.viewbox-left-site.viewbox-left-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-site.viewbox-right-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-mid-site.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");


                fireInspectionByThirtyDays()
                loadFireRecordTable(2)
                searchType = 2;
                $('.mid-site-record-tool input').val("")
            }
        }, {
            path: '/plan',
            id: 'menu4',
            function: function() {
                $('.viewbox-left-site.viewbox-left-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-site.viewbox-right-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-record-box').addClass("hidden-view");

                $('.viewbox-mid-site.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.left-site-plan.viewbox-left-site-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.mid-site-plan.viewbox-mid-site-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                queryPlanBySite();
            }

        }, {
            path: '/safetyAccount',
            id: 'menu7',
            function: function() {
                $('.viewbox-left-safetyAccount.viewbox-left-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-site.viewbox-right-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-record-box').addClass("hidden-view");

                $('.viewbox-mid-site.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.left-site-safetyAccount.viewbox-left-site-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.mid-site-safetyAccount.viewbox-mid-site-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                // queryPlanBySite();
				
				$('.mid-site-safetyAccount-list').addClass("hidden-view");
				$('.mid-site-safetyAccount-tabe').removeClass('hidden-view');
            }

        }, {
            path: '/fireeye',
            id: 'menu5',
            function: function() {
                $('.viewbox-left-fireeye.viewbox-left-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-right-fireeye.viewbox-right-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                $('.viewbox-mid-fireeye.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
                loadFireeyeTable();
                fireeyeHistogram();
                fireEyesCurrentStatus(2);
                fireEyesCurrentWarnStatus(2);
                $('.mid-fireeye-table-tool input').val("");
            }

        }, {
            path: '/electricalSafety',
            id: 'menu8',
            function: function() {
                $('.viewbox-left-box').siblings().addClass("hidden-view");
                $('.viewbox-right-box').siblings().addClass("hidden-view");
                $('.viewbox-mid-electricalSafety.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
				loadelectricalSafetyTable();
                // loadFireeyeTable();
                // fireeyeHistogram();
                // fireEyesCurrentStatus(2);
                // fireEyesCurrentWarnStatus(2);
                $('.mid-electricalSafety-table-tool input').val("");
            }

        }, {
            path: '/yangan',
            id: 'menu9',
            function: function() {
                $('.viewbox-left-box').siblings().addClass("hidden-view");
                $('.viewbox-right-box').siblings().addClass("hidden-view");
                $('.viewbox-mid-yangan.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
				loadyanganTable();
                // loadFireeyeTable();
                // fireeyeHistogram();
                // fireEyesCurrentStatus(2);
                // fireEyesCurrentWarnStatus(2);
                $('.mid-yangan-table-tool input').val("");
            }

        },{
            path: '/shuixiang',
            id: 'menu10',
            function: function() {
                $('.viewbox-left-box').siblings().addClass("hidden-view");
                $('.viewbox-right-box').siblings().addClass("hidden-view");
                $('.viewbox-mid-shuixiang.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
				loadshuixiangTable();
                // loadFireeyeTable();
                // fireeyeHistogram();
                // fireEyesCurrentStatus(2);
                // fireEyesCurrentWarnStatus(2);
                $('.mid-shuixiang-table-tool input').val("");
            }

        },{
            path: '/bengshuiya',
            id: 'menu11',
            function: function() {
                $('.viewbox-left-box').siblings().addClass("hidden-view");
                $('.viewbox-right-box').siblings().addClass("hidden-view");
                $('.viewbox-mid-bengshuiya.viewbox-mid-box').removeClass("hidden-view").siblings().addClass("hidden-view");
				loadbengshuiyaTable();
                // loadFireeyeTable();
                // fireeyeHistogram();
                // fireEyesCurrentStatus(2);
                // fireEyesCurrentWarnStatus(2);
                $('.mid-bengshuiya-table-tool input').val("");
            }

        },{
            path: '*',
            redirect: '/home'
        }]
    });